<template>
  <div class="gzl">
    <div style="background: white;height: 170px;margin: 0px auto;padding-top: 10px">
      <div style="float: left;height: 100%;width: 10%">
        <span
          style="display: block;text-align: center;font-weight: 700;font-size: 16px;margin-bottom: 20px;margin-top: 20px">待接收</span>
        <span style="display: block;text-align: center;font-weight: 700;font-size: 36px">{{ count }}</span>
      </div>
      <!--上边tab框-->
      <div style="float: right;height: 100%;width: 90%">
        <el-table class="table" stripe :data="tableData_phoneMainList" style="width: 100%"
                  :row-style="{height: '45px'}">
          <el-table-column label="日期" align="center">
            <template v-slot="scope">
              <span>{{ renderTime(scope.row.createOnTime) }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="carType" label="车型" align="center"/>
          <el-table-column prop="carNumber" label="车牌号" align="center"/>
          <el-table-column prop="clientName" label="联系人" align="center"/>
          <el-table-column prop="clientPhone" label="联系方式" align="center"/>
          <el-table-column label="来源" align="center">
            <template><span>电话</span></template>
          </el-table-column>
          <el-table-column label="操作" align="center">
            <template slot-scope="scope">
              <el-button
                v-if="scope.row.status==0"
                size="small"
                type="primary"
                @click="accept(scope.row.id)"
              >接受
              </el-button>
              <el-button
                v-if="scope.row.status==1"
                size="small"
                type="primary"
                @click="showRepair(scope.row.id)"
              >处理
              </el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
    <!--    <div class="pgnt">-->
    <!--      <el-pagination-->
    <!--        background-->
    <!--        layout="prev, pager, next"-->
    <!--        :current-page="current"-->
    <!--        :page-size="pagesize"-->
    <!--        @current-change="handleCurrentChange"-->
    <!--        :page-count="total"-->
    <!--      >-->
    <!--      </el-pagination>-->
    <!--    </div>-->
    <!--处理维修记录-->
    <el-dialog
      title="维修服务现场记录单"
      :visible.sync="dialogVisible"
      width="70%"
      :modal-append-to-body="false"
    >
      <ul>
        <li><span>维修服务日期</span>
          <el-date-picker style="width: 60%" v-model="repairInfo.maintainTime" type="date"
                          placeholder="选择日期"></el-date-picker>
        </li>
        <li><span>维修服务站</span>
          <el-input disabled style="width: 60%" v-model="repairInfo.siteName"></el-input>
        </li>
      </ul>
      <ul class="khUL">
        <li><span>客户单位</span>
          <el-input style="width: 60%" v-model="repairInfo.clientUnits"></el-input>
        </li>
        <li><span>联系人</span>
          <el-input style="width: 60%" v-model="repairInfo.clientName"></el-input>
        </li>
        <li><span>联系方式(区号)</span>
          <el-input style="width: 60%" v-model="repairInfo.clientPhone"></el-input>
        </li>
        <li><span>联系地址</span>
          <el-input style="width: 60%" v-model="repairInfo.clientAdress"></el-input>
        </li>
        <li><span>车辆品牌/车型</span>
          <el-input style="width: 60%" v-model="repairInfo.carType"></el-input>
        </li>
        <li><span>车牌号</span>
          <el-input style="width: 60%" v-model="repairInfo.carNumber"></el-input>
        </li>
        <li><span>服务人员</span>
          <el-input style="width: 60%" placeholder="请输入操作人姓名" v-model="repairInfo.fuwurenyuan"></el-input>
        </li>
        <li><span>电话</span>
          <el-input style="width: 60%" placeholder="请输入操作人手机" v-model="repairInfo.fuwurenyuanPhone"></el-input>
        </li>
      </ul>
      <ul class="BXfw">
        <li><span>出厂编号</span>
          <el-input style="width: 60%" placeholder="请输入出厂编号" v-model="repairInfo.chuchangbianhao"></el-input>
        </li>
        <li><span>保修卡号</span>
          <el-input style="width: 60%" placeholder="请输入保修卡号" v-model="repairInfo.baoxiukahao"></el-input>
        </li>
        <li><span>购车日期</span>
          <el-date-picker
            style="width: 60%"
            v-model="repairInfo.goucheTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </li>
        <li><span>压缩机号</span>
          <el-input style="width: 60%" placeholder="请输入压缩机号" v-model="repairInfo.yasuojihao"></el-input>
        </li>
        <li><span>底盘号</span>
          <el-input style="width: 60%" placeholder="请输入底盘号" v-model="repairInfo.dipanhao"></el-input>
        </li>
        <li><span>发动机号</span>
          <el-input style="width: 60%" placeholder="请输入发动机号" v-model="repairInfo.fadongjihao"></el-input>
        </li>
        <li><span>行驶证登记日期</span>
          <!--<el-input style="width: 60%"placeholder="请输入行驶证登记日期" v-model="repairInfo.xingshizhengTime"></el-input>-->
          <el-date-picker
            style="width: 60%"
            v-model="repairInfo.xingshizhengTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </li>
        <li><span>行驶里程</span>
          <el-input style="width: 60%" placeholder="请输入行驶里程" v-model="repairInfo.xingshilicheng"></el-input>
        </li>
        <li><span>三包期</span>
          <el-radio disabled v-model="repairInfo.sanbaoqi" label="1">是</el-radio>
          <el-radio disabled v-model="repairInfo.sanbaoqi" label="2">否</el-radio>
        </li>
        <li><span>车辆用途</span>
          <el-input style="width: 60%" placeholder="车辆用途" v-model="repairInfo.cheliangyongtu"></el-input>
        </li>
      </ul>
      <ul>
        <li>
          <span>选择处理方式:</span>
          <template>
            <el-radio v-model="radio_dealWith" label="1" @change="checkDataComplete(1)">现场维护</el-radio>
            <el-radio v-model="radio_dealWith" label="2" @change="checkDataComplete(2)">更换配件</el-radio>
          </template>
        </li>
      </ul>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
        <el-button @click="dialogVisible = false">取 消</el-button>
      </span>
    </el-dialog>
    <!--处理-->
    <el-dialog
      title="处理"
      :visible.sync="dialogVisible1"
      width="70%"
      :modal-append-to-body="false">
      <div>
        <ul>
          <li>
            <span>处理结果:</span>
            <el-input style="width: 70%" v-model="dealWithResult"></el-input>
          </li>
        </ul>
        <ul>
          <li>
            <span>故障现象:</span>
            <el-input style="width: 50%" v-model="guzhangxianxiang"></el-input>
          </li>
          <li>
            <span>系统异常时:</span>
            <el-input style="width: 50%" v-model="xitongyichang"></el-input>
          </li>
        </ul>
        <ul>
          <li>
            <span>原因分析:</span>
            <el-input type="textarea"
                      :autosize="{ minRows: 5, maxRows: 6}"
                      placeholder="信息描述 :" v-model="yuanyin"></el-input>
          </li>
        </ul>
      </div>
      <p>上传现场维修照片</p>
      <ul style="margin-top: 20px">
        <li>
          <div style="width: 148px;height: 148px;display: inline-block;overflow: hidden">
            <el-upload
              action="/JX_java/common/fileUpLoad" list-type="picture-card" :limit="2"
              :show-file-list="false"
              :on-remove="function(res,file){ return handleRemove(res,file)}"
              :on-success="function (res, file) { return handleSuccess_1(res, file)}"
              :before-upload="beforeImageUpload"
              :file-list="fileList1"
            >
              <el-image v-if="ImgPath1" :src="ImgPath1"></el-image>
              <i v-else class="el-icon-plus"></i>
            </el-upload>
          </div>
        </li>
        <li>
          <div style="width: 148px;height: 148px;display: inline-block;overflow: hidden">
            <el-upload
              action="/JX_java/common/fileUpLoad" list-type="picture-card" :limit="2"
              :show-file-list="false"
              :on-remove="function(res,file){ return handleRemove(res,file)}"
              :on-success="function (res, file) { return handleSuccess_2(res, file)}"
              :before-upload="beforeImageUpload"
              :file-list="fileList2"
            >
              <el-image v-if="ImgPath2" :src="ImgPath2"/>
              <i v-else class="el-icon-plus"></i>
            </el-upload>
          </div>
        </li>
        <li>
          <div style="width: 148px;height: 148px;display: inline-block;overflow: hidden">
            <el-upload
              action="/JX_java/common/fileUpLoad" list-type="picture-card" :limit="2"
              :show-file-list="false"
              :on-remove="function(res,file){ return handleRemove(res,file)}"
              :on-success="function (res, file) { return handleSuccess_3(res, file)}"
              :before-upload="beforeImageUpload"
              :file-list="fileList3"
            >
              <el-image v-if="ImgPath3" :src="ImgPath3"></el-image>
              <i v-else class="el-icon-plus"></i>
            </el-upload>
          </div>
        </li>
      </ul>
      <div>
        <p style="display: inline-block">
          费用明细
        </p>
        <el-button type="primary" plain size="mini" icon="el-icon-plus" @click="dynamicAdd(1)">新增</el-button>
      </div>
      <template>
        <el-table
          :max-height="240"
          height="240"
          :data="tableData_manpowers"
          style="width: 100%">
          <el-table-column prop="date" label="作业内容" width="180">
            <template v-slot="scope">
              <el-input v-model="scope.row.zuoyeneirong"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="name" label="维修工时" width="180">
            <template v-slot="scope">
              <el-input v-model="scope.row.weixiugongshi"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="金额(元)">
            <template v-slot="scope">
              <el-input v-model="scope.row.money"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="差旅费(元)">
            <template v-slot="scope">
              <el-input v-model="scope.row.chalvfei"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="其他费用(元)">
            <template v-slot="scope">
              <el-input v-model="scope.row.qitafeiyong"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="操作">
            <template v-slot="scope">
              <el-button @click="dynamicRemove(scope.$index,1)" size="mini" type="danger"
                         icon="el-icon-delete"></el-button>
            </template>
          </el-table-column>
        </el-table>
      </template>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dialogVisible1 = false;dealWithConfirm()">确 定</el-button>
        <el-button @click="dialogVisible1 = false;radio_dealWith=null">取 消</el-button>
      </span>
    </el-dialog>
    <!--申请详情-->
    <el-dialog
      title="申请详情"
      :visible.sync="dialogVisible2"
      width="70%"
      :modal-append-to-body="false">
      <template>
        <el-button type="primary" size="mini" icon="el-icon-plus" @click="dynamicAdd(2)">新增</el-button>
        <el-table
          :data="tableDataApply"
          style="width: 100%">
          <el-table-column
            type="index"
            label="序号"
          >
          </el-table-column>
          <el-table-column
            prop="name"
            label="车型"
          >
            <template v-slot="scope">
              <el-input v-model="scope.row.productType"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="物料名称">
            <template v-slot="scope">
              <!--<el-input v-model="scope.row.productName"></el-input>-->
              <el-select value-key="id" v-model="scope.row.productName" placeholder="请选择"
                         @change="handleChangeProductName1(scope.$index,$event)">
                <el-option
                  v-for="item in options_AllProducts"
                  :key="item.id"
                  :label="item.productName"
                  :value="item">
                </el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="图号">
            <template v-slot="scope">
              <el-input disabled v-model="scope.row.productTuhao"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="三包期">
            <template v-slot="scope">
              <el-checkbox v-model="scope.row.sanbaoqian=true">是</el-checkbox>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="价格">
            <template v-slot="scope">
              <el-input v-model="scope.row.danjia"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="数量">
            <template v-slot="scope">
              <el-input v-model="scope.row.number"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="管理费">
            <template v-slot="scope">
              <el-input v-model="scope.row.guanlif"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="操作">
            <template v-slot="scope">
              <el-button @click="dynamicRemove(scope.$index,2)" size="mini" type="danger"
                         icon="el-icon-delete"></el-button>
            </template>
          </el-table-column>
        </el-table>
      </template>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dialogVisible2 = false;dealWithConfirm()">确 定</el-button>
        <el-button @click="dialogVisible2 = false;radio_dealWith=null">取 消</el-button>
      </span>
    </el-dialog>
    <!--收货详情-->
    <el-dialog
      title="收货详情"
      :visible.sync="dialogVisible3"
      width="70%"
      :modal-append-to-body="false">
      <template>
        <el-table
          :data="tableData2"
          style="width: 100%">
          <el-table-column
            prop="date"
            label="序号"
          >
          </el-table-column>
          <el-table-column label="车型">
            <template v-slot="scope">
              <el-input v-model="scope.row.productType"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="物料名称">
            <template v-slot="scope">
              <el-select v-model="scope.row.productName" placeholder="请选择"
                         @change="handleChangeProductName(scope.$index,$event)">
                <el-option
                  v-for="item in options_AllProducts"
                  :key="item.id"
                  :label="item.productName"
                  :value="item">
                </el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="图号">
            <template v-slot="scope">
              <el-input disabled v-model="scope.row.productTuhao"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="三包期">
            <template v-slot="scope">
              <el-radio value="1" label="1">是</el-radio>
            </template>
          </el-table-column>

          <el-table-column
            prop="address"
            label="价格">
            <template v-slot="scope">
              <el-input v-model.number="scope.row.danjia"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="数量">
            <template v-slot="scope">
              <el-input v-model.number="scope.row.number"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="管理费">
            <template v-slot="scope">
              <el-input v-model.number="scope.row.guanlif"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="操作">
            <template v-slot="scope">
              <el-button @click="dynamicRemove(scope.$index,3)" size="mini" type="danger"
                         icon="el-icon-delete"></el-button>
            </template>
          </el-table-column>
        </el-table>
      </template>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dialogVisible3 = false">确 定</el-button>
        <el-button @click="dialogVisible3 = false">取 消</el-button>
      </span>
    </el-dialog>
    <!--搜索框-->
    <div class="search">
      <el-form :inline="true" :model="search" class="demo-form-inline">
        <el-form-item label="输入搜索">
          <el-input
            v-model="search.key"
            placeholder="请输入设备名称"
          ></el-input>
        </el-form-item>
        <el-form-item label="输入时间">
          <el-date-picker
            v-model="search.time"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            type="daterange"
            range-separator="-"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            @change="chage"
          ></el-date-picker>
        </el-form-item>
        <el-form-item
        >
          <el-button type="primary" @click="onsubmit"
          >查询
          </el-button
          >
        </el-form-item
        >
      </el-form>
      <el-button class="ebtn" type="warning" @click="orderadd()">新增维护</el-button>
    </div>
    <!--下边tab框-->
    <div style="background: white;height: 390px;margin: 0px auto;padding-top: 30px">
      <el-table class="table" stripe :data="tableDataOperated" style="width: 100%" height="380">
        <el-table-column type="index" label="序号" align="center" width="70"/>
        <el-table-column label="日期" align="center">
          <template slot-scope="scope">
            {{ renderTime(scope.row.maintainTime) }}
          </template>
        </el-table-column>
        <el-table-column prop="carType" label="车型" align="center"/>
        <el-table-column prop="carNumber" label="车牌号" align="center"/>
        <el-table-column prop="xingshizhengTime" label="行驶证日期" align="center">
          <template slot-scope="scope">
            {{ renderTime(scope.row.xingshizhengTime) }}
          </template>
        </el-table-column>
        <el-table-column prop="siteLingdao" label="接收人" align="center"/>
        <el-table-column label="状态" align="center">
          <template v-slot="scope">
            <span v-if="scope.row.status==1">待接收</span>
            <span v-if="scope.row.status==2">维护中</span>
            <span v-if="scope.row.status==3">审核中</span>
            <span v-if="scope.row.status==4">已完成</span>
            <el-button v-if="scope.row.status == 5" type="text" size="medium"
                       @click="getBOhui(scope.row.checkFolwId)">驳回
            </el-button>
            <!--            <span v-if="scope.row.status==5">驳回</span>-->
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <el-button v-if="scope.row.status==2" size="small" type="primary"
                       @click="dialogVisible4 = true;showDetail(scope.row.id)">申请
            </el-button>
            <el-button v-if="scope.row.status==2" size="small" type="warning"
                       @click="dialogVisible5 = true;showMaintenance(scope.row.id)">维护
            </el-button>
            <el-button size="small" type="text" @click="showDetail1(scope.row.id)">详情</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <el-pagination
      background
      layout="prev, pager, next"
      :current-page="current"
      :page-size="pagesize"
      @current-change="handleCurrentChange"
      :total="total">
    </el-pagination>
    <!--申请详情-->
    <el-dialog
      title="申请"
      :visible.sync="dialogVisible4"
      width="70%"
      :modal-append-to-body="false">
      <template>
        <el-button type="primary" plain size="mini" icon="el-icon-plus" @click="dynamicAdd(3)">新增</el-button>
        <el-table :data="tableData3_apply" style="width: 100%">
          <el-table-column type="index" label="序号">
          </el-table-column>
          <el-table-column label="车型">
            <template v-slot="scope">
              <el-input v-model="scope.row.productType"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="物料名称">
            <template v-slot="scope">
              <el-select v-model="scope.row.productName" placeholder="请选择"
                         @change="handleChangeProductName(scope.$index,$event)">
                <el-option
                  v-for="item in options_AllProducts"
                  :key="item.id"
                  :label="item.productName"
                  :value="item">
                </el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="图号">
            <template v-slot="scope">
              <el-input disabled v-model="scope.row.productTuhao"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="三包期">
            <template v-slot="scope">
              <el-radio value="1" label="1">是</el-radio>
            </template>
          </el-table-column>

          <el-table-column
            prop="address"
            label="价格">
            <template v-slot="scope">
              <el-input v-model.number="scope.row.danjia"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="数量">
            <template v-slot="scope">
              <el-input v-model.number="scope.row.number"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="管理费">
            <template v-slot="scope">
              <el-input v-model.number="scope.row.guanlif"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="操作">
            <template v-slot="scope">
              <el-button @click="dynamicRemove(scope.$index,3)" size="mini" type="danger"
                         icon="el-icon-delete"></el-button>
            </template>
          </el-table-column>
        </el-table>
      </template>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm_addProduct">确 定</el-button>
        <el-button @click="dialogVisible4 = false">取 消</el-button>
      </span>
    </el-dialog>
    <!-- 维护信息-->
    <el-dialog
      title="维修信息"
      :visible.sync="dialogVisible5"
      width="70%"
      :modal-append-to-body="false">
      <!--顶部维修信息与上传照片-->
      <div class="bigbox">
        <div class="header-box1">
          <p>维修信息</p>
          <ul>
            <li style="width: 40%">
              <span>处理结果:</span>
              <el-input style="width: 70%" v-model="maintain_info.chulijieguo"></el-input>
            </li>
            <li style="width: 50%">
              <span>故障现象 :</span>
              <el-input style="width: 70%" v-model="maintain_info.guzhangxianxiang"></el-input>
            </li>
            <li style="width: 50%">
              <span>系统异常时:</span>
              <el-input style="width: 70%" v-model="maintain_info.xitongyichang"></el-input>
            </li>
            <li class="big-box">
              <span>原因分析 :</span>
              <el-input style="width: 80%" v-model="maintain_info.yuanyin"></el-input>
            </li>
          </ul>
        </div>
        <div class="header-box2">
          <p>上传照片</p>
          <ul>
            <li>
              <div style="width: 148px;height: 148px;display: inline-block;overflow: hidden">
                <el-upload
                  action="/JX_java/common/fileUpLoad" list-type="picture-card" :limit="2"
                  :show-file-list="false"
                  :on-remove="function(res,file){ return handleRemove(res,file)}"
                  :on-success="function (res, file) { return handleSuccess_1(res, file)}"
                  :before-upload="beforeImageUpload"
                  :file-list="fileList1"
                >
                  <el-image v-if="ImgPath1" :src="ImgPath1"></el-image>
                  <i v-else class="el-icon-plus"></i>
                </el-upload>
              </div>
            </li>
            <li>
              <div style="width: 148px;height: 148px;display: inline-block;overflow: hidden">
                <el-upload
                  action="/JX_java/common/fileUpLoad" list-type="picture-card" :limit="2"
                  :show-file-list="false"
                  :on-remove="function(res,file){ return handleRemove(res,file)}"
                  :on-success="function (res, file) { return handleSuccess_2(res, file)}"
                  :before-upload="beforeImageUpload"
                  :file-list="fileList2"
                >
                  <el-image v-if="ImgPath2" :src="ImgPath2"/>
                  <i v-else class="el-icon-plus"></i>
                </el-upload>
              </div>
            </li>
            <li>
              <div style="width: 148px;height: 148px;display: inline-block;overflow: hidden">
                <el-upload
                  action="/JX_java/common/fileUpLoad" list-type="picture-card" :limit="2"
                  :show-file-list="false"
                  :on-remove="function(res,file){ return handleRemove(res,file)}"
                  :on-success="function (res, file) { return handleSuccess_3(res, file)}"
                  :before-upload="beforeImageUpload"
                  :file-list="fileList3"
                >
                  <el-image v-if="ImgPath3" :src="ImgPath3"></el-image>
                  <i v-else class="el-icon-plus"></i>
                </el-upload>
              </div>
            </li>
          </ul>
        </div>
      </div>
      <!--换购纪录-->
      <div class="intermediate">
        <ul>
          <li>
            <p style="display: inline-block">换购记录</p>
            <!--<el-button type="primary" plain size="mini" icon="el-icon-plus" @click="dynamicAdd(4)">新增</el-button>-->
          </li>
        </ul>
        <template>
          <el-table
            height="200"
            max-height="200"
            :data="tableData_RedeemLog"
            style="width: 100%;font-size: 12px">
            <el-table-column
              type="index"
              label="序号"
            >
            </el-table-column>
            <el-table-column
              prop="productType"
              label="车型"
            >
            </el-table-column>
            <el-table-column
              prop="productName"
              label="物料名称">
            </el-table-column>
            <el-table-column
              prop="productTuhao"
              label="图号">
            </el-table-column>
            <el-table-column
              prop="address"
              label="三包期">
              <template>
                <el-checkbox v-model="checked"></el-checkbox>
              </template>
            </el-table-column>
            <el-table-column
              prop="danjia"
              label="价格">
            </el-table-column>
            <el-table-column
              prop="number"
              label="数量">
            </el-table-column>
            <el-table-column prop="guanlif" label="管理费">
            </el-table-column>
          </el-table>
        </template>
      </div>
      <!--维护费用清单-->
      <div class="footer">
        <ul style="padding-top: 10px;">
          <li>
            <p style="display: inline-block">维护费用清单</p>
            <!--<el-button type="primary" plain size="mini" icon="el-icon-plus" @click="dynamicAdd(5)">新增</el-button>-->
          </li>
        </ul>
        <template>
          <el-table
            height="200"
            max-height="200"
            :data="tableList_MaintenanceCostList"
            style="width: 100%">
            <el-table-column label="作业内容">
              <template v-slot="scope">
                <el-input v-model="scope.row.zuoyeneirong"></el-input>
              </template>
            </el-table-column>
            <el-table-column label="维修工时">
              <template v-slot="scope">
                <el-input v-model="scope.row.weixiugongshi"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="金额（元）">
              <template v-slot="scope">
                <el-input v-model="scope.row.money"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="差旅费（元）">
              <template v-slot="scope">
                <el-input v-model="scope.row.chalvfei"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="其他费用（元）">
              <template v-slot="scope">
                <el-input v-model="scope.row.qitafeiyong"></el-input>
              </template>
            </el-table-column>
          </el-table>
        </template>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="addMaintenanceConfirm()">确 定</el-button>
        <el-button @click="dialogVisible5 = false">取 消</el-button>
      </span>
    </el-dialog>

    <!--新增-->
    <el-dialog
      title="维修服务现场记录单"
      :visible.sync="dialogVisible_Xu"
      width="70%"
      :modal-append-to-body="false"
    >
      <ul>
        <li><span>维修服务日期</span>
          <el-date-picker style="width: 60%" v-model="tablelist.maintainTime" type="date"
                          placeholder="选择日期"></el-date-picker>
        </li>
        <li><span>维修服务站</span>
          <el-input disabled style="width: 60%" v-model="siteName"></el-input>
        </li>
      </ul>
      <ul class="khUL">
        <li><span>客户单位</span>
          <el-input style="width: 60%" v-model="tablelist.clientUnits" placeholder="请输入客户单位"></el-input>
        </li>
        <li><span>联系人</span>
          <el-input style="width: 60%" v-model="tablelist.clientName" placeholder="请输入联系人"></el-input>
        </li>
        <li><span>联系方式(区号)</span>
          <el-input style="width: 60%" v-model="tablelist.clientPhone" placeholder="请输入联系方式"></el-input>
        </li>
        <li><span>联系地址</span>
          <el-input style="width: 60%" v-model="tablelist.clientAdress" placeholder="请输入联系地址"></el-input>
        </li>
        <li><span>车辆品牌/车型</span>
          <el-input style="width: 60%" v-model="tablelist.carType" placeholder="请输入车辆品牌/车型"></el-input>
        </li>
        <li><span>车牌号</span>
          <el-input style="width: 60%" v-model="tablelist.carNumber" placeholder="请输入车牌号"></el-input>
        </li>
        <li><span>服务人员</span>
          <el-input style="width: 60%" placeholder="请输入操作人姓名" v-model="tablelist.fuwurenyuan"></el-input>
        </li>
        <li><span>电话</span>
          <el-input style="width: 60%" placeholder="请输入操作人手机" v-model="tablelist.fuwurenyuanPhone"></el-input>
        </li>
      </ul>
      <ul class="BXfw">
        <li><span>出厂编号</span>
          <el-input style="width: 60%" placeholder="请输入出厂编号" v-model="tablelist.chuchangbianhao"></el-input>
        </li>
        <li><span>保修卡号</span>
          <el-input style="width: 60%" placeholder="请输入保修卡号" v-model="tablelist.baoxiukahao"></el-input>
        </li>
        <li><span>购车日期</span>
          <el-date-picker
            style="width: 60%"
            v-model="tablelist.goucheTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </li>
        <li><span>压缩机号</span>
          <el-input style="width: 60%" placeholder="请输入压缩机号" v-model="tablelist.yasuojihao"></el-input>
        </li>
        <li><span>底盘号</span>
          <el-input style="width: 60%" placeholder="请输入底盘号" v-model="tablelist.dipanhao"></el-input>
        </li>
        <li><span>发动机号</span>
          <el-input style="width: 60%" placeholder="请输入发动机号" v-model="tablelist.fadongjihao"></el-input>
        </li>
        <li><span>行驶证登记日期</span>
          <el-date-picker
            style="width: 60%"
            v-model="tablelist.xingshizhengTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </li>
        <li><span>行驶里程</span>
          <el-input style="width: 60%" placeholder="请输入行驶里程" v-model="tablelist.xingshilicheng"></el-input>
        </li>
        <li>
          <span>三包期</span>
          <el-radio disabled v-model="tablelist.sanbaoqi" label="1">是</el-radio>
          <el-radio disabled v-model="tablelist.sanbaoqi" label="2">否</el-radio>
        </li>
        <li><span>车辆用途</span>
          <el-input style="width: 60%" placeholder="车辆用途" v-model="tablelist.cheliangyongtu"></el-input>
        </li>
      </ul>
      <ul>
        <li>
          <span>选择处理方式:</span>
          <template>
            <el-radio v-model="radio_dealWith1" label="1" @change="checkDataComplete1_xu(1)">现场维护</el-radio>
            <el-radio v-model="radio_dealWith1" label="2" @change="checkDataComplete1_xu(2)">更换配件</el-radio>
          </template>
        </li>
      </ul>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible_Xu = false">取 消</el-button>
      </span>
    </el-dialog>

    <!--新增处理-->
    <!--处理-->
    <el-dialog
      title="处理"
      :visible.sync="dialogVisible_xu_0"
      width="70%"
      :modal-append-to-body="false">
      <div>
        <ul>
          <li>
            <span>处理结果:</span>
            <el-input style="width: 70%" v-model="tablelist.chulijieguo"></el-input>
          </li>
        </ul>
        <ul>
          <li>
            <span>故障现象:</span>
            <el-input style="width: 50%" v-model="tablelist.guzhangxianxiang"></el-input>
          </li>
          <li>
            <span>系统异常时:</span>
            <el-input style="width: 50%" v-model="tablelist.xitongyichang"></el-input>
          </li>
        </ul>
        <ul>
          <li>
            <span style="display:inline-block;margin-bottom: 10px;">原因分析:</span>
            <el-input type="textarea"
                      :autosize="{ minRows: 5, maxRows: 6}"
                      placeholder="信息描述 :" v-model="yuanyin"></el-input>
          </li>
        </ul>
      </div>
      <p>上传现场维修照片</p>
      <ul style="margin-top: 20px">
        <li>
          <div style="width: 148px;height: 148px;display: inline-block;overflow: hidden">
            <el-upload
              action="/JX_java/common/fileUpLoad" list-type="picture-card" :limit="2"
              :show-file-list="false"
              :on-remove="function(res,file){ return handleRemove(res,file)}"
              :on-success="function (res, file) { return handleSuccess_XU(res, file)}"
              :before-upload="beforeImageUpload"
              :file-list="fileList_XU"
            >
              <el-image v-if="ImgPath_XU" :src="ImgPath_XU"></el-image>
              <i v-else class="el-icon-plus"></i>
            </el-upload>
          </div>
        </li>
        <li>
          <div style="width: 148px;height: 148px;display: inline-block;overflow: hidden">
            <el-upload
              action="/JX_java/common/fileUpLoad" list-type="picture-card" :limit="2"
              :show-file-list="false"
              :on-remove="function(res,file){ return handleRemove(res,file)}"
              :on-success="function (res, file) { return handleSuccess_XU_1(res, file)}"
              :before-upload="beforeImageUpload"
              :file-list="fileList_XU_1"
            >
              <el-image v-if="ImgPath_XU_1" :src="ImgPath_XU_1"/>
              <i v-else class="el-icon-plus"></i>
            </el-upload>
          </div>
        </li>
        <li>
          <div style="width: 148px;height: 148px;display: inline-block;overflow: hidden">
            <el-upload
              action="/JX_java/common/fileUpLoad" list-type="picture-card" :limit="2"
              :show-file-list="false"
              :on-remove="function(res,file){ return handleRemove(res,file)}"
              :on-success="function (res, file) { return handleSuccess_XU_2(res, file)}"
              :before-upload="beforeImageUpload"
              :file-list="fileList_XU_2"
            >
              <el-image v-if="ImgPath_XU_2" :src="ImgPath_XU_2"></el-image>
              <i v-else class="el-icon-plus"></i>
            </el-upload>
          </div>
        </li>
      </ul>
      <div>
        <p style="display: inline-block">
          费用明细
        </p>
      </div>
      <template>
        <el-table
          :max-height="240"
          height="240"
          :data="tablelist.manpowers"
          style="width: 100%">
          <el-table-column prop="date" label="作业内容" width="180">
            <template v-slot="scope">
              <el-input v-model="scope.row.zuoyeneirong"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="name" label="维修工时" width="180">
            <template v-slot="scope">
              <el-input v-model="scope.row.weixiugongshi"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="金额(元)">
            <template v-slot="scope">
              <el-input v-model="scope.row.money"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="差旅费(元)">
            <template v-slot="scope">
              <el-input v-model="scope.row.chalvfei"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="其他费用(元)">
            <template v-slot="scope">
              <el-input v-model="scope.row.qitafeiyong"></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="操作">
            <template v-slot="scope">
              <el-button type="primary" size="small" @click="addDomain1"
              >新增
              </el-button
              >
              <el-button
                type="danger"
                @click="resetForm1(scope)"
                v-if="scope.$index !== 0"
                size="small"
              >删除
              </el-button
              >
            </template>
          </el-table-column>
        </el-table>
      </template>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="ADDList()">确 定</el-button>
        <el-button @click="dialogVisible_xu_0 = false;radio_dealWith=null">取 消</el-button>
      </span>
    </el-dialog>
    <!--新增申请-->
    <!--申请-->
    <el-dialog
      title="申请详情"
      :visible.sync="dialogVisible_xu_01"
      width="70%"
      :modal-append-to-body="false">
      <template>
        <!--        <el-button type="primary" size="mini" icon="el-icon-plus" @click="dynamicAdd(2)">新增</el-button>-->
        <el-table
          :data="tablelist.useparts"
          style="width: 100%">
          <el-table-column
            type="index"
            label="序号"
          >
          </el-table-column>
          <el-table-column
            label="车型"
          >
            <template v-slot="scope">
              <el-input v-model="scope.row.productType"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            label="物料名称">
            <template v-slot="scope">
              <el-select value-key="id" v-model="scope.row.productName" placeholder="请选择"
                         @change="handleChangeProductName_xu(scope.$index,$event)">
                <el-option
                  v-for="item in options_AllProducts"
                  :key="item.id"
                  :label="item.productName"
                  :value="item">
                </el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column
            label="图号">
            <template v-slot="scope">
              <el-input disabled v-model="scope.row.productTuhao"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            label="三包期">
            <template v-slot="scope">
              <el-checkbox v-model="scope.row.sanbaoqian=true">是</el-checkbox>
            </template>
          </el-table-column>
          <el-table-column
            label="价格">
            <template v-slot="scope">
              <el-input v-model="scope.row.danjia"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            label="数量">
            <template v-slot="scope">
              <el-input v-model="scope.row.number"></el-input>
            </template>
          </el-table-column>
          <el-table-column
            label="管理费">
            <template v-slot="scope">
              <el-input v-model="scope.row.guanlif"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="操作">
            <template v-slot="scope">
              <el-button type="primary" size="small" @click="addDomain"
              >新增
              </el-button
              >
              <el-button
                type="danger"
                @click="resetForm(scope)"
                v-if="scope.$index !== 0"
                size="small"
              >删除
              </el-button
              >
            </template>
          </el-table-column>
        </el-table>
      </template>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="ADDList()">确 定</el-button>
        <el-button @click="dialogVisible_xu_01 = false;radio_dealWith=null">取 消</el-button>
      </span>
    </el-dialog>

    <el-dialog
      title="驳回详情"
      :visible.sync="dialogVisible_bohui"
      width="50%"
      :modal-append-to-body="false">
      <ul :data="bohuilist" class="bohuizujian">
        <li>
          <span>审核日期</span>
          <el-input v-model="bohuilist.checkTime" style="width: 70%;" disabled></el-input>
        </li>
        <li>
          <span>审核人</span>
          <el-input v-model="bohuilist.userName" style="width: 70%;" disabled></el-input>
        </li>
        <li>
          <span>驳回理由</span>
          <el-input v-model="bohuilist.bohuiReason" style="width: 70%;" disabled></el-input>
        </li>
      </ul>
      <span slot="footer" class="dialog-footer">
    <el-button type="primary" @click="dialogVisible_bohui = false">返 回</el-button>
  </span>
    </el-dialog>
  </div>
</template>
<script>
import axios from 'axios'

export default {
  inject: ['reload'],
  components: {},
  data() {
    return {//
      dialogVisible_bohui: false,
      bohuilist: {
        bohuiReason: "",
        checkTime: "",
        userName: "",
      },
      tableList_MaintenanceCostList: [],
      tableData_RedeemLog: [],
      maintain_info: {},
      yuanyin: "",
      fuwuzhan: "",
      guzhangxianxiang: "",
      xitongyichang: "",
      options_AllProducts: [],
      tableData3_apply: [],
      tableDataOperated: [],
      GLOBALId: null,
      tableDataApply: [],
      dealWithResult: "",
      fileList1: [],
      fileList2: [],
      fileList3: [],
      ImgPath1: "",
      ImgPath2: "",
      ImgPath3: "",
      tableData_manpowers: [],
      radio_dealWith: null,
      SiteInfo: {},//站点信息
      repairInfo: {siteId: 0, siteName: "", sanbaoqi: '1'},
      tableData_phoneMainList: [],
      count: 0,
      search: {key: "", start: "", end: ""},
      total: 1,
      current: 1,
      pagesize: 10,
      tableData: [{}],
      //维修记录单弹出层
      dialogVisible: false,
      //处理方式两个弹出层
      dialogVisible1: false,
      dialogVisible2: false,
      radio: '1',
      //收货
      dialogVisible3: false,
      //下面三个弹出层
      dialogVisible4: false,
      dialogVisible5: false,
      dialogVisible6: false,
      //新增
      dialogVisible_Xu: false,
      dialogVisible_xu_0: false,
      dialogVisible_xu_01: false,
      //图片格式合集
      imgpathfull: '',
      imgpath: '',
      imgpathfull1: '',
      imgpath1: '',
      imgpathfull2: '',
      imgpath2: '',
      //费用明细
      tableData1: [{}],
      //收货详情
      tableData2: [{}],
      //申请详情
      tableData3: [{}],
      //
      tableList: [{}],
      checked: true,
      //新增
      fileList_XU: [],
      fileList_XU_1: [],
      fileList_XU_2: [],
      ImgPath_XU: "",
      ImgPath_XU_1: "",
      ImgPath_XU_2: "",
      radio_dealWith1: null,
      tablelist: {
        siteId: 0, siteName: "", sanbaoqi: '1',
        useparts: [{}],
        manpowers: [{}],
        // chulijieguo:"",
        // id:"",
      },
    };
  },
  //监听属性 类似于data概念",
  computed: {},
  //监控data中的数据变化",
  watch: {},
  //方法集合",
  methods: {
    getBOhui(checkflowId) {
      this.dialogVisible_bohui = true
      axios("/JX_java/procurement/getCheckFlowDetails?checkFlowId=" + checkflowId).then((res) => {
        console.log(res)
        let relse = res.data.data
        this.bohuilist = relse
        console.log(this.bohuilist)
      })
    },
    //新增跳转
    checkDataComplete1_xu(index) {
      let flag = 0;
      if (this.tablelist.chuchangbianhao == null || this.tablelist.baoxiukahao == null || this.tablelist.goucheTime == null || this.tablelist.yasuojihao == null
        || this.tablelist.dipanhao == null || this.tablelist.fadongjihao == null || this.tablelist.xingshizhengTime == null || this.tablelist.xingshilicheng == null
        || this.tablelist.cheliangyongtu == null
      ) {
        this.$message.error("请将信息内容填写完整")
        this.radio_dealWith1 = null
        flag = 1
      }
      if (index == 1 && flag == 0) {
        this.dialogVisible_xu_0 = true;
        // this.radio_dealWith1 = null
      } else if (index == 2 && flag == 0) {
        this.dialogVisible_xu_01 = true;
        // this.radio_dealWith1 = null
      }
    },
    handleChangeProductName_xu(index, e) {
      this.tablelist.useparts[index].partId = e.id
      this.tablelist.useparts[index].productName = e.productName
      this.tablelist.useparts[index].productTuhao = e.productTuhao
    },
    handleSuccess_XU(res, file) {
      this.fileList_XU = []
      console.log(this.fileList)
      this.fileList_XU.push({name: res.data.name, url: res.data.url});
      this.ImgPath_XU = res.data.url;
      console.log(this.fileList_XU)
    },
    handleSuccess_XU_1(res, file) {
      this.fileList_XU_1 = []
      this.fileList_XU_1.push({name: res.data.name, url: res.data.url})
      this.ImgPath_XU_1 = res.data.url;
      console.log(this.fileList_XU_1)
    },
    handleSuccess_XU_2(res, file) {
      this.fileList_XU_2 = []
      this.fileList_XU_2.push({name: res.data.name, url: res.data.url})
      this.ImgPath_XU_2 = res.data.url;
      console.log(this.fileList_XU_2)
    },
    //新增采购-------动态添加
    addDomain() {
      const list = {
        productName: ""
      };
      this.tablelist.useparts.push(list);
    },
    //新增采购-------动态删除
    resetForm(e) {
      console.log(e);
      this.tablelist.useparts.splice(e.$index, 1);
    },
    //------------------------------------
    //新增采购-------动态添加
    addDomain1() {
      const list = {
        zuoyeneirong: "",
      };
      this.tablelist.manpowers.push(list);
    },
    //新增采购-------动态删除
    resetForm1(e) {
      console.log(e);
      this.tablelist.manpowers.splice(e.$index, 1);
    },
    ADDList() {
      let listDataArr = JSON.parse(localStorage.getItem("listDataArr"));
      let SiteId =  JSON.parse(localStorage.getItem("listDataArr")).id
      console.log(SiteId)
      let param = {
        "applyTime": "",
        "baoxiukahao": "",
        "carNumber": "",
        "carType": "",
        "cheliangyongtu": "",
        "chuchangbianhao": "",
        "chulijieguo": "",
        "clientAdress": "",
        "clientName": "",
        "clientPhone": null,
        "clientUnits": "",
        "createOnTime": "",
        "dipanhao": "",
        "fadongjihao": "",
        "fuwurenyuan": "",
        "fuwurenyuanPhone": null,
        "fuwuzhan": listDataArr.siteName,
        "goucheTime": "",
        "guzhangxianxiang": "",
        "id": 0,
        "kaipiaoLogid": 0,
        "maintainMoney": 0,
        "maintainTime": "",
        "manpowers": [],
        "partMoney": 0,
        "phoneMaintainId": 0,
        "photoAdress": "",
        "sanbaoqi": 1,
        "shengheMessageId": 0,
        "shengheStatus": 0,
        "shengqinId": 0,
        "shengqinRole": 0,
        "siteId": SiteId,
        "siteLingdao": listDataArr.siteResponsible,
        "siteLingdaoId": listDataArr.siteResponsibleId,
        "siteName": listDataArr.siteName,
        "status": 0,
        "type": "",
        "useparts": [],
        "xingshilicheng": "",
        "xingshizhengTime": "",
        "xitongyichang": "",
        "yasuojihao": "",
        "yuanyin": ""
      }
      // console.log(param ,this.radio_dealWith1)
      // return
      if (this.radio_dealWith1 == 1) {
        // param.id = this.GLOBALId
        param.type = 1;//车辆用途
        param.maintainTime = this.tablelist.maintainTime
        // param.siteName = this.tablelist.siteName
        // param.siteId = this.tablelist.siteId
        param.clientUnits = this.tablelist.clientUnits
        param.clientName = this.tablelist.clientName
        param.clientPhone = this.tablelist.clientPhone
        param.clientAdress = this.tablelist.clientAdress
        param.carType = this.tablelist.carType
        param.carNumber = this.tablelist.carNumber
        param.fuwurenyuan = this.tablelist.fuwurenyuan
        param.fuwurenyuanPhone = this.tablelist.fuwurenyuanPhone
        param.chuchangbianhao = this.tablelist.chuchangbianhao
        param.baoxiukahao = this.tablelist.baoxiukahao
        param.goucheTime = this.tablelist.goucheTime
        param.yasuojihao = this.tablelist.yasuojihao
        param.dipanhao = this.tablelist.dipanhao
        param.fadongjihao = this.tablelist.fadongjihao
        param.xingshizhengTime = this.tablelist.xingshizhengTime
        param.xingshilicheng = this.tablelist.xingshilicheng
        param.sanbaoqi = 1
        param.cheliangyongtu = this.tablelist.cheliangyongtu
        param.chulijieguo = this.tablelist.chulijieguo
        param.manpowers = []
        param.guzhangxianxiang = this.tablelist.guzhangxianxiang
        param.xitongyichang = this.tablelist.xitongyichang
        param.yuanyin = this.yuanyin
        param.photoAdress = JSON.stringify(this.fileList_XU).toString() + "@" + JSON.stringify(this.fileList_XU_1).toString() + "@" + JSON.stringify(this.fileList_XU_2).toString()
        this.tablelist.manpowers.forEach(e => {
          let dd = {
            "chalvfei": 0,
            "id": 0,
            "money": 0,
            "qitafeiyong": 0,
            "shenghemessageId": 0,
            "siteMaintainId": 0,
            "status": 0,
            "totalPrices": 0,
            "usePartid": 0,
            "weixiugongshi": 0,
            "zuoyeneirong": ""
          }
          dd.chalvfei = e.chalvfei;
          dd.qitafeiyong = e.qitafeiyong;
          dd.weixiugongshi = e.weixiugongshi;
          dd.zuoyeneirong = e.zuoyeneirong;
          dd.money = e.money
          param.manpowers.push(dd)
        })
        console.log(param, 1111111111111111111111111)
        axios.post("/JX_java/site/siteMaintain/addOrupdateSiteMaintain", param).then(res => {
          console.log(res.data.data)
          if (res.data.data == "操作成功") {
            this.$message.success(res.data.data);
            this.dialogVisible_Xu = false
            this.dialogVisible_xu_0 = false
            this.reload();
          } else {
            this.$message.error(res.data.data);
          }
        })
      } else if (this.radio_dealWith1 == 2) {
        param.id = this.GLOBALId
        param.type = 2;//车辆用途
        param.maintainTime = this.tablelist.maintainTime
        // param.siteId = this.tablelist.siteId
        param.clientUnits = this.tablelist.clientUnits
        param.clientName = this.tablelist.clientName
        param.clientPhone = this.tablelist.clientPhone
        param.clientAdress = this.tablelist.clientAdress
        param.carType = this.tablelist.carType
        param.carNumber = this.tablelist.carNumber
        param.fuwurenyuan = this.tablelist.fuwurenyuan
        param.fuwurenyuanPhone = this.tablelist.fuwurenyuanPhone
        param.chuchangbianhao = this.tablelist.chuchangbianhao
        param.baoxiukahao = this.tablelist.baoxiukahao
        param.goucheTime = this.tablelist.goucheTime
        param.yasuojihao = this.tablelist.yasuojihao
        param.dipanhao = this.tablelist.dipanhao
        param.fadongjihao = this.tablelist.fadongjihao
        param.xingshizhengTime = this.tablelist.xingshizhengTime
        param.xingshilicheng = this.tablelist.xingshilicheng
        param.sanbaoqi = 1
        param.useparts = []
        param.cheliangyongtu = this.tablelist.cheliangyongtu
        this.tablelist.useparts.forEach(e => {
          let aa = {
            "applyTime": "",
            "danjia": 0,
            "guanlif": 0,
            "id": 0,
            "number": 0,
            "partId": 0,
            "productName": "",
            "productTuhao": "",
            "productType": "",
            "sanbaoqian": 0,
            "shenghemessageId": 0,
            "siteMaintainId": 0,
            "status": 0,
            "xuhao": 1
          }
          aa.guanlif = e.guanlif
          aa.partId = e.partId
          aa.siteMaintainId = this.GLOBALId
          aa.danjia = e.danjia
          aa.number = e.number
          aa.productName = e.productName
          aa.productTuhao = e.productTuhao
          aa.productType = e.productType
          aa.sanbaoqian = 1
          param.useparts.push(aa)
        })
        console.log(param, 11111111111)
        // return
        axios.post("/JX_java/site/siteMaintain/addOrupdateSiteMaintain", param).then(res => {
          console.log(res.data.data)
          if (res.data.data == "操作成功") {
            this.$message.success(res.data.data);
            this.dialogVisible_Xu = false
            this.dialogVisible_xu_01 = false;
            this.reload();
          } else {
            this.$message.error(res.data.data);
          }
        })
      }
    },
    //----------------------------------------许---------------------------------------------------
    showDetail1(e) {
      this.$router.push({
        path: "/SiteMaintenanceAdd", query: {
          id: e, isDetail: true
        }
      })
    },
    addMaintenanceConfirm() {
      let param = {
        "applyTime": "",
        "baoxiukahao": null,
        "carNumber": null,
        "carType": null,
        "cheliangyongtu": null,
        "chuchangbianhao": null,
        "chulijieguo": this.maintain_info.chulijieguo,
        "clientAdress": null,
        "clientName": null,
        "clientPhone": null,
        "clientUnits": null,
        "createOnTime": "",
        "dipanhao": null,
        "fadongjihao": null,
        "fuwurenyuan": null,
        "fuwurenyuanPhone": null,
        "fuwuzhan": this.SiteInfo.siteName,
        "goucheTime": null,
        "guzhangxianxiang": this.maintain_info.guzhangxianxiang,
        "id": this.maintain_info.id,
        "kaipiaoLogid": null,
        "maintainMoney": null,
        "maintainTime": "",
        "manpowers": [],
        "partMoney": null,
        "phoneMaintainId": null,
        "photoAdress": null,
        "sanbaoqi": 1,
        "shengheMessageId": null,
        "shengheStatus": null,
        "shengqinId": null,
        "shengqinRole": null,
        "siteId": this.SiteInfo.id,
        "siteLingdao": this.SiteInfo.siteResponsible,
        "siteLingdaoId": this.SiteInfo.siteResponsibleId,
        "siteName": this.SiteInfo.siteName,
        "status": 0,
        "type": 0,
        "useparts": null,
        "xingshilicheng": null,
        "xingshizhengTime": null,
        "xitongyichang": this.maintain_info.xitongyichang,
        "yasuojihao": null,
        "yuanyin": this.maintain_info.yuanyin,
      }
      param.photoAdress = JSON.stringify(this.fileList1).toString() + "@" + JSON.stringify(this.fileList2).toString() + "@" + JSON.stringify(this.fileList3).toString();
      this.tableList_MaintenanceCostList.forEach(e => {
        let aa = {
          "chalvfei": 0,
          "id": 0,
          "money": 0,
          "qitafeiyong": 0,
          "shenghemessageId": 0,
          "siteMaintainId": 0,
          "status": 0,
          "totalPrices": null,
          "usePartid": 0,
          "weixiugongshi": 0,
          "zuoyeneirong": ""
        };
        aa.chalvfei = e.chalvfei
        aa.money = e.money
        aa.qitafeiyong = e.qitafeiyong
        aa.siteMaintainId = e.siteMaintainId
        aa.weixiugongshi = e.weixiugongshi
        aa.zuoyeneirong = e.zuoyeneirong
        aa.usePartid = e.usePartid
        aa.siteMaintainId = e.siteMaintainId
        param.manpowers.push(aa)
      })
      console.log(param)
      axios.post("/JX_java/site/addSiteMainManpower", param).then(res => {
        console.log()
        if (res.data.data == "操作成功") {
          this.$message.success(res.data.data);
          this.reload();
          this.dialogVisible5 = false;
        } else {
          this.$message.error(res.data.data);
        }
      })
    },
    showMaintenance(e) {
      axios.get("/JX_java/site/siteMaintain/applyDetails?type=" + 2 + "&&siteMainId=" + e).then(res => {
        console.log(res.data.data)
        this.maintain_info.id = e
        this.tableData_RedeemLog = res.data.data//maintain_info
        if (this.tableData_RedeemLog.length >= 0) {
          this.tableList_MaintenanceCostList = []
          for (let i = 0; i < this.tableData_RedeemLog.length; i++) {
            this.tableList_MaintenanceCostList.push({
              usePartid: this.tableData_RedeemLog[i].id,
              siteMaintainId: this.tableData_RedeemLog[i].siteMaintainId
            })
          }
        }
      })
    },
    handleChangeProductName1(index, e) {
      this.tableDataApply[index].partId = e.id
      this.tableDataApply[index].productName = e.productName
      this.tableDataApply[index].productTuhao = e.productTuhao
    },
    handleChangeProductName(index, e) {
      this.tableData3_apply[index].partId = e.id
      this.tableData3_apply[index].productName = e.productName
      this.tableData3_apply[index].productTuhao = e.productTuhao
    },
    //获取所有的产品
    getAllProduct() {
      axios.get("/JX_java/common/getSitePartsList").then(res => {
        console.log(res.data.data)
        this.options_AllProducts = res.data.data
      })
    },
    confirm_addProduct() {
      let param = []
      this.tableData3_apply.forEach(e => {
        let aa = {
          "applyTime": "",
          "danjia": 0,
          "guanlif": 0,
          "id": 0,
          "number": 0,
          "partId": 0,
          "productName": "",
          "productTuhao": "",
          "productType": "",
          "sanbaoqian": 0,
          "shenghemessageId": 0,
          "siteMaintainId": 0,
          "status": 0,
          "xuhao": 1
        }
        aa.guanlif = e.guanlif;
        aa.partId = e.partId
        aa.siteMaintainId = this.GLOBALId;
        aa.productType = e.productType
        aa.productName = e.productName
        aa.productTuhao = e.productTuhao
        aa.sanbaoqian = 1
        aa.danjia = e.danjia
        aa.number = e.number
        param.push(aa)
      })
      axios.post("/JX_java/site/siteMaintain/addUseparts", param).then(res => {
        if (res.data.data == "操作成功") {
          this.$message.success(res.data.data);
          this.reload();
          this.dialogVisible4 = false
        } else {
          this.$message.error(res.data.data);
        }
      })
    },
    showDetail(e) {
      this.GLOBALId = e
      console.log(e)
    },
    dynamicRemove(index, type) {
      if (type == 1) {
        this.tableData_manpowers.splice(index, 1);
      }
      if (type == 2) {
        this.tableDataApply.splice(index, 1);
      }
      if (type == 3) {
        this.tableData3_apply.splice(index, 1);
      }
      if (type == 4) {
        this.tableData_RedeemLog.splice(index, 1)
      }
      if (type == 5) {
        this.tableList_MaintenanceCostList.splice(index, 1);
      }

    },
    handleSuccess_1(res, file) {
      this.fileList1 = []
      console.log(this.fileList)
      this.fileList1.push({name: res.data.name, url: res.data.url});
      this.ImgPath1 = res.data.url;
      console.log(this.fileList1)
    },
    handleSuccess_2(res, file) {
      this.fileList2 = []
      this.fileList2.push({name: res.data.name, url: res.data.url})
      this.ImgPath2 = res.data.url;
      console.log(this.fileList2)
    },
    handleSuccess_3(res, file) {
      this.fileList3 = []
      this.fileList3.push({name: res.data.name, url: res.data.url})
      this.ImgPath3 = res.data.url;
      console.log(this.fileList3)
    },
    //图片格式的验证
    beforeImageUpload(file) {
      const isJPG = file.type === 'image/jpeg';
      const isLt2M = file.size / 1024 / 1024 < 2;
      if (!isJPG) {
        this.$message.error('上传头像图片只能是 JPG 格式!');
      }
      if (!isLt2M) {
        this.$message.error('上传头像图片大小不能超过 2MB!');
      }
      return isJPG && isLt2M;
    },
    //动态增加
    dynamicAdd(type) {
      if (type == 1) {
        this.tableData_manpowers.push({});
      }
      if (type == 2) {
        this.tableDataApply.push({});
      }
      if (type == 3) {
        this.tableData3_apply.push({});
      }
      if (type == 4) {
        this.tableData_RedeemLog.push({})
      }
      if (type == 5) {
        this.tableList_MaintenanceCostList.push({})
      }
    },
    checkDataComplete(index) {
      let flag = 0;
      if (this.repairInfo.chuchangbianhao == null || this.repairInfo.baoxiukahao == null || this.repairInfo.goucheTime == null || this.repairInfo.yasuojihao == null
        || this.repairInfo.dipanhao == null || this.repairInfo.fadongjihao == null || this.repairInfo.xingshizhengTime == null || this.repairInfo.xingshilicheng == null
        || this.repairInfo.cheliangyongtu == null
      ) {
        this.$message.error("请将信息内容填写完整")
        this.radio_dealWith = null
        flag = 1
      }
      if (index == 1 && flag == 0) {
        this.dialogVisible1 = true;
      } else if (index == 2 && flag == 0) {
        this.dialogVisible2 = true;
      }
    },
    getSiteInfo() {
      this.SiteInfo = JSON.parse(localStorage.getItem("listDataArr"));
      if (!this.SiteInfo) {
        this.$message.error("当前登录人,没有授权站点信息,请联系管理员处理");
        this.$router.push("/");
      } else {
        this.repairInfo.siteId = this.SiteInfo.id
        this.repairInfo.siteName = this.SiteInfo.siteName
      }
    },
    showRepair(e) {
      this.GLOBALId = e
      axios.get("/JX_java/site/getSiteMainDetails?siteMainId=" + e).then(res => {
        console.log(res.data.data)
        this.repairInfo = res.data.data
        this.repairInfo.sanbaoqi = "1"
        this.repairInfo.xingshizhengTime = null;
        this.repairInfo.goucheTime = null
        this.dialogVisible = true;
      })

    },
    dealWithConfirm() {
      let listDataArr = JSON.parse(localStorage.getItem("listDataArr"));
      let param = {
        "applyTime": "",
        "baoxiukahao": "",
        "carNumber": "",
        "carType": "",
        "cheliangyongtu": "",
        "chuchangbianhao": "",
        "chulijieguo": "",
        "clientAdress": "",
        "clientName": "",
        "clientPhone": null,
        "clientUnits": "",
        "createOnTime": "",
        "dipanhao": "",
        "fadongjihao": "",
        "fuwurenyuan": "",
        "fuwurenyuanPhone": null,
        "fuwuzhan": listDataArr.siteName,
        "goucheTime": "",
        "guzhangxianxiang": this.guzhangxianxiang,
        "id": 0,
        "kaipiaoLogid": 0,
        "maintainMoney": 0,
        "maintainTime": "",
        "manpowers": [],
        "partMoney": 0,
        "phoneMaintainId": 0,
        "photoAdress": "",
        "sanbaoqi": 0,
        "shengheMessageId": 0,
        "shengheStatus": 0,
        "shengqinId": 0,
        "shengqinRole": 0,
        "siteId": listDataArr.id,
        "siteLingdao": listDataArr.siteResponsible,
        "siteLingdaoId": listDataArr.siteResponsibleId,
        "siteName": listDataArr.siteName,
        "status": 0,
        "type": 0,
        "useparts": [
          /*{
            "applyTime": "",
            "danjia": 0,
            "guanlif": 0,
            "id": 0,
            "number": 0,
            "partId": 0,
            "productName": "木鱼",
            "productTuhao": "muyu",
            "productType": "大汽车",
            "sanbaoqian": 0,
            "shenghemessageId": 0,
            "siteMaintainId": 0,
            "status": 0,
            "xuhao": 1
          }*/
        ],
        "xingshilicheng": "",
        "xingshizhengTime": "",
        "xitongyichang": this.xitongyichang,
        "yasuojihao": "",
        "yuanyin": this.yuanyin
      }
      if (this.radio_dealWith == 1) {
        param.id = this.GLOBALId
        param.type = 1;//车辆用途
        param.maintainTime = this.repairInfo.maintainTime
        param.siteName = this.repairInfo.siteName
        param.siteId = this.repairInfo.siteId
        param.clientUnits = this.repairInfo.clientUnits
        param.clientName = this.repairInfo.clientName
        param.clientPhone = this.repairInfo.clientPhone
        param.clientAdress = this.repairInfo.clientAdress
        param.carType = this.repairInfo.carType
        param.carNumber = this.repairInfo.carNumber
        param.fuwurenyuan = this.repairInfo.fuwurenyuan
        param.fuwurenyuanPhone = this.repairInfo.fuwurenyuanPhone
        param.chuchangbianhao = this.repairInfo.chuchangbianhao
        param.baoxiukahao = this.repairInfo.baoxiukahao
        param.goucheTime = this.repairInfo.goucheTime
        param.yasuojihao = this.repairInfo.yasuojihao
        param.dipanhao = this.repairInfo.dipanhao
        param.fadongjihao = this.repairInfo.fadongjihao
        param.xingshizhengTime = this.repairInfo.xingshizhengTime
        param.xingshilicheng = this.repairInfo.xingshilicheng
        param.sanbaoqi = 1
        param.cheliangyongtu = this.repairInfo.cheliangyongtu
        param.chulijieguo = this.dealWithResult
        param.photoAdress = JSON.stringify(this.fileList1).toString() + "@" + JSON.stringify(this.fileList2).toString() + "@" + JSON.stringify(this.fileList3).toString()
        // param.manpowers  dealWithResult fileList1....  tableData_manpowers
        this.tableData_manpowers.forEach(e => {
          let dd = {
            "chalvfei": 0,
            "id": 0,
            "money": 0,
            "qitafeiyong": 0,
            "shenghemessageId": 0,
            "siteMaintainId": 0,
            "status": 0,
            "totalPrices": 0,
            "usePartid": 0,
            "weixiugongshi": 0,
            "zuoyeneirong": ""
          }
          dd.chalvfei = e.chalvfei;
          dd.qitafeiyong = e.qitafeiyong;
          dd.weixiugongshi = e.weixiugongshi;
          dd.zuoyeneirong = e.zuoyeneirong;
          dd.money = e.money
          param.manpowers.push(dd)
        })
        console.log(param)

        axios.post("/JX_java/site/siteMaintain/updateSiteMaintainStatus", param).then(res => {
          console.log(res.data.data)
          if (res.data.data == "操作成功") {
            this.$message.success(res.data.data);
            this.dialogVisible = false
            this.dialogVisible1=false
            this.reload()
          } else {
            this.$message.error(res.data.data);
          }
        })
      } else if (this.radio_dealWith == 2) {
        param.id = this.GLOBALId
        param.type = 2;//车辆用途
        param.maintainTime = this.repairInfo.maintainTime
        param.siteName = this.repairInfo.siteName
        param.siteId = this.repairInfo.siteId
        param.clientUnits = this.repairInfo.clientUnits
        param.clientName = this.repairInfo.clientName
        param.clientPhone = this.repairInfo.clientPhone
        param.clientAdress = this.repairInfo.clientAdress
        param.carType = this.repairInfo.carType
        param.carNumber = this.repairInfo.carNumber
        param.fuwurenyuan = this.repairInfo.fuwurenyuan
        param.fuwurenyuanPhone = this.repairInfo.fuwurenyuanPhone
        param.chuchangbianhao = this.repairInfo.chuchangbianhao
        param.baoxiukahao = this.repairInfo.baoxiukahao
        param.goucheTime = this.repairInfo.goucheTime
        param.yasuojihao = this.repairInfo.yasuojihao
        param.dipanhao = this.repairInfo.dipanhao
        param.fadongjihao = this.repairInfo.fadongjihao
        param.xingshizhengTime = this.repairInfo.xingshizhengTime
        param.xingshilicheng = this.repairInfo.xingshilicheng
        param.sanbaoqi = 1
        param.cheliangyongtu = this.repairInfo.cheliangyongtu
        // param.useparts
        this.tableDataApply.forEach(e => {
          let aa = {
            "applyTime": "",
            "danjia": 0,
            "guanlif": 0,
            "id": 0,
            "number": 0,
            "partId": 0,
            "productName": "木鱼",
            "productTuhao": "muyu",
            "productType": "大汽车",
            "sanbaoqian": 0,
            "shenghemessageId": 0,
            "siteMaintainId": 0,
            "status": 0,
            "xuhao": 1
          }
          aa.guanlif = e.guanlif
          aa.partId = e.partId
          aa.siteMaintainId = this.GLOBALId
          aa.danjia = e.danjia
          aa.number = e.number
          aa.productName = e.productName
          aa.productTuhao = e.productTuhao
          aa.productType = e.productType
          aa.sanbaoqian = 1
          param.useparts.push(aa)
        })
        console.log(param)
        axios.post("/JX_java/site/siteMaintain/updateSiteMaintainStatus", param).then(res => {
          console.log(res.data.data)
          if (res.data.data == "操作成功") {
            this.$message.success(res.data.data);
          } else {
            this.$message.error(res.data.data);
          }
        })
      }
    },
    accept(e) {
      axios.get("/JX_java/site/siteMaintain/acceptSiteMaintain?siteMaintainId=" + e).then(res => {
        if (res.data.data == "操作成功") {
          this.$message.success(res.data.data)
          this.dialogVisible = false
          this.dialogVisible2 = false
          this.reload();
        } else {
          this.$message.error(res.data.data)
        }

      })
    },
    //格式化时间
    renderTime(date) {
      return date == null ? "" : date.substring(0, 10);
    },
    //获取页面信息
    getList() {
      let param = {
        "beginTime": "",
        "endTime": "",
        "key": "",
        "pageNum": 0,
        "pageSize": 0,
        "type": 0
      }
      let siteInfo = JSON.parse(localStorage.getItem("listDataArr"));
      let siteId = siteInfo.id;
      axios.post("/JX_java/site/siteMaintain/getSiteMaintainList?siteId=" + siteId, param).then(res => {
        console.log(res.data.data,111111111111111111111)
        let {count, phoneMainList, content, totalPages} = res.data.data
        this.count = count
        this.tableData_phoneMainList = phoneMainList
        this.total = res.data.data.totalPages
        this.tableDataOperated = content
      })
    },
    handleCurrentChange(e) {
      this.current=e;
      this.getList();
    },
    handleAvatarSuccess(res, file) {
      this.imageUrl = URL.createObjectURL(file.raw);
    },
    handleExceed() {
    },
    handleChange() {
    },
    handlePreview() {
    },
    handleRemove(file) {
      console.log(res);
    },
    handleAvatarSuccess0(res, file, name) {
      this[name] = res.data;
    },
    //新增
    orderadd() {
      this.dialogVisible_Xu = true
    },
    orderxq() {
      this.$router.push("/SiteMaintenancexq");
    },
    chage(e) {
      if (e) {
        this.search.start = e[0];
        this.search.end = e[1];
      } else {
        this.search.start = "";
        this.search.end = "";
      }
    },
    onsubmit() {
      this.getList();
      // this.LoadContents();
    },
  },
  //生命周期 - 创建之前",数据模型未加载,方法未加载,html模板未加载
  beforeCreate() {
  },
  //生命周期 - 创建完成（可以访问当前this实例）",数据模型已加载，方法已加载,html模板已加载,html模板未渲染
  created() {
    this.siteName = JSON.parse(localStorage.getItem("listDataArr")).siteName
    console.log(JSON.parse(localStorage.getItem("listDataArr")),1111111111111)
    this.getSiteInfo();
    this.getList();
    this.getAllProduct();
  },
  //生命周期 - 挂载之前",html模板未渲染
  beforeMount() {
  },
  //生命周期 - 挂载完成（可以访问DOM元素）",html模板已渲染
  mounted() {
  },
  //生命周期 - 更新之前",数据模型已更新,html模板未更新
  beforeUpdate() {
  },
  //生命周期 - 更新之后",数据模型已更新,html模板已更新
  updated() {
  },
  //生命周期 - 销毁之前",
  beforeDestroy() {
  },
  destroyed() {
  },
  //生命周期 - 销毁完成",
  //如果页面有keep-alive缓存功能，这个函数会触发",
  activated() {
  },
}
</script>
<style lang="scss" scoped>
.bohuizujian {
  display: flex;
  flex-wrap: wrap;

  li {
    width: 33%;
    padding-top: 10px;
    text-align: center;

    span {
      display: inline-block;
      width: 25%;
    }
  }
}

.search {
  margin-top: 15px;
  height: 50px;
  border-radius: 5px;
  background-color: #fff;
  padding-left: 20px;
  padding-top: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}

.gzl {
  padding-left: 10px;
  padding-right: 10px;
  padding-top: 10px;
}

.el-dialog {
  p {
    margin-top: 10px;
  }

  ul {
    width: 100%;
    display: flex;
    //color: #909399;
    li {
      width: 33%;
      font-size: 14px;
      margin-bottom: 10px;

    }

  }

  .khUL {
    margin-top: 20px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;

    li {

      width: 25%;
      font-size: 14px;
      margin-bottom: 10px;

      span {
        display: inline-block;
        width: 32%;
        font-weight: 400;
      }
    }
  }

  .BXfw {
    margin-top: 20px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;

    li {
      width: 25%;
      font-size: 14px;
      margin-bottom: 10px;

      span {
        display: inline-block;
        margin-top: 10px;
        width: 32%;
        font-weight: 400;
      }
    }
  }

  .imgbox {
    margin-top: 20px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;

    li {
      margin-bottom: 10px;
      text-align: center;
    }
  }

  .el-table {
    margin-top: 10px;

    /deep/ .is-leaf {
      text-align: center;
    }

    /deep/ .cell {
      text-align: center;
    }
  }
}

.search {
  height: 50px;
  border-radius: 5px;
  background-color: #fff;
  padding-left: 20px;
  padding-top: 10px;
  // margin: 0 20px 20px;
  margin-bottom: 10px;
}

.demo-form-inline {
  display: inline-block;
}

.el-pagination {
  margin-top: 15px;
  text-align: center;
}

.ebtn {
  float: right;
  margin-right: 20px;
}

.bigbox {
  display: flex;
  flex-wrap: wrap;

  .header-box1 {
    width: 50%;

    p {
      //margin-bottom: 20px;
    }


    ul {
      margin-top: 20px;
      width: 100%;
      display: flex;
      flex-wrap: wrap;

      li {
        width: 50%;
        font-size: 14px;
        margin-bottom: 10px;

        span {
          display: inline-block;
          width: 20%;
          font-weight: 400;
        }
      }

      .big-box {
        width: 100%;
      }
    }
  }

  .header-box2 {
    width: 50%;

    ul {
      margin-top: 20px;
      width: 100%;

      li {
        width: 50%;
        font-size: 14px;
        margin-bottom: 10px;

        span {
          display: inline-block;
          width: 20%;
          font-weight: 400;
        }
      }
    }
  }
}

.intermediate {
  ul {
    margin-top: 20px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;

    li {
      width: 33%;
      font-size: 14px;
      margin-bottom: 10px;

      span {
        display: inline-block;
        width: 20%;
        font-weight: 400;
        font-size: 14px;
      }
    }
  }
}
</style>
